import java.io.Serializable;

/* INSTANT MESSANGER BETA
 * @module: Message
 * @author: Daniel Mayer
 * @version: beta 0.1
 * @date: 18.04.2013
 * @last_update: 24.06.2013
 */

public class Message implements Serializable {

	private static final long serialVersionUID = -671898046834245419L;
	//Variablen
	private String message;
	private String transmitter;
	private int type;
	private int twinName;
	private String userList[];
	
	//Nachrichtentypen
	//*******************************************
	//private static final int typeLogout = -1;
	//private static final int typeLogin = 0;
	//private static final int typeTwinname = 1;
	//private static final int typeMessage = 2;
	//private static final int typeBroadcast = 3;
	//private static final int userList = 4;
	//private static final int connectionRefused = 5;
	//*******************************************
	
	//Konstruktor
	//***********
	
	public Message () {
		
	}
	public Message(int type){
		this.type = type;
		if (this.type == 3){
			setMessage("NULL");
			setTransmitter("NULL");
		}
	}
	
	//SET-Methoden
	//************
	public void setMessage(String message){
		this.message = message;
	}
	
	public void setTransmitter(String transmitter){
		this.transmitter = transmitter;
	}
	
	public void setTwinName(int twin){
		this.twinName = twin;
	}
	
	public void setUserListe(String ul []){
		this.userList = ul;
	}
	
	//GET-Methoden
	//************
	public String getMessage(){
		return this.message;
	}
	
	public String getTransmitter(){
		return this.transmitter;
	}
	
	public int getType(){
		return this.type;
	}
	
	public int getTwinName(){
		return this.twinName;
	}

	public String[] getUserList(){
		return this.userList;
	}
}
